package com.vq3.digitalizationsoftwareintegrates.Service.BusinessCenter.Impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.vq3.digitalizationsoftwareintegrates.Entity.BusinessCenter.BusinessCenterEntity;
import com.vq3.digitalizationsoftwareintegrates.Entity.BusinessCenter.BusinessCenterEntity_perEntity;
import com.vq3.digitalizationsoftwareintegrates.Entity.User.Permission_TBEntity;
import com.vq3.digitalizationsoftwareintegrates.Entity.User.User_RoleEntity;
import com.vq3.digitalizationsoftwareintegrates.Mapper.BusinessCenter.BusinessCenterMapper;
import com.vq3.digitalizationsoftwareintegrates.Mapper.BusinessCenter.BusinessCenter_perMapper;
import com.vq3.digitalizationsoftwareintegrates.Service.BusinessCenter.BusinessCenterService;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collection;
import java.util.List;

@Service
public class BusinessCenterServiceImpl implements BusinessCenterService {
    @Resource
    BusinessCenter_perMapper businessCenter_perMapper;
    @Resource
    BusinessCenterMapper businessCenterMapper;

    @Override
    public List<BusinessCenterEntity_perEntity> perFindBusinessCenterId(Permission_TBEntity permission_tbEntity) {
        QueryWrapper<BusinessCenterEntity_perEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("per",permission_tbEntity.getPermission());
        return businessCenter_perMapper.selectList(queryWrapper);
    }

    @Override
    public BusinessCenterEntity findBusinessCenterSideBar(Integer bid) {
        QueryWrapper<BusinessCenterEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("bid",bid);
        return businessCenterMapper.selectOne(queryWrapper);
    }
}
